import apiClient from "../axios";

export const updateAssistant = async (params) => {
    const assistantId = params.id;
    // 创建一个params的副本，并删除id字段
    const requestBody = { ...params };
    delete requestBody.id;
    
    try {
        // 尝试使用POST而不是PUT
        const response = await apiClient.post(`/ragflow/api/v1/update/assistant/${assistantId}`, requestBody);
        return response.data;
    } catch (error) {
        console.error('更新助手时出错:', error.response || error);
        throw error;
    }
}
